package net;

/**
 *
 */
public class Student {
    public String name;//属性
    //方法
    public void study(){
        System.out.println("我是"+name+",正在学习");
    }
    public static void hi() {
        System.out.println("hi,everybody!");
    }

}

class Hello{
    public static void main(String[] args){
        Student s1=new Student();//用new实例化对象
        Student s2=new Student();
        Student.hi();//可直接调用
        s1.name="张三";
        s1.study();//没有static要先实例化，再调用
        s2.name="李艾";
        s2.study();
    }
}